Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ci): upload built binaries to GitHub Releases on tag creation #810

Merged
merged 3 commits into from
Aug 17, 2024

Conversation

p5
Copy link
Contributor

@p5 p5 commented Aug 16, 2024

What this Pull Request (PR) does

Updates the GitHub Actions workflow to be triggered on tag creation.
On tag creation, it runs the regular builds, but the only difference is a final step to upload the artifacts to GitHub Releases so they are discoverable.

Also manages the Go version in a single go.mod file, rather than across two different files, where the workflow version is easily forgotten.

Finally updates the binary names to not include the distribution. ubuntu-latest binaries work on Fedora, so therefore it makes more sense to me to call them linux and darwin.

Related issues

Closes #808

@p5 p5 marked this pull request as ready for review August 16, 2024 22:51
Comment on lines +15 to +16
permissions:
contents: write
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should provide the workflow with permissions to upload assets to GitHub releases.

@@ -20,26 +24,30 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a new Checkout action


- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22.1'
go-version-file: ./go.mod
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stop maintaining the Go version in two places.


- name: Build binary on Linux and macOS
if: matrix.os != 'windows-latest'
env:
OS: ${{ matrix.os == 'ubuntu-latest' && 'linux' || 'darwin' }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebrand the ubuntu-latest binary to linux, and the macos-latest binary to darwin.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strongly suggest removing the "put inside dmg" step on macos/darwin while you're at it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I'm not on the project, or involved in any way, I don't want to remove any functionality in this PR. That's a decision for the maintainers.

I have, however, updated the pipeline to keep the MacOS binary around as well as the dmg in 3b35d88.


- name: Build binary on Windows
if: matrix.os == 'windows-latest'
env:
OS: windows
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebrand the windows-latest binary to windows

Comment on lines +68 to +71
- name: Upload release artifact
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
run: |
gh release upload ${{ github.ref_name }} fabric-*-${{ matrix.arch }}-${{ github.ref_name }}*
Copy link
Contributor Author

@p5 p5 Aug 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upload the built files to GitHub Releases when invoked from a tag push.
Not entirely sure if this will work, but it will at least attempt to upload the artifacts.

@xssdoctor xssdoctor merged commit 1a458c1 into danielmiessler:main Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature request]: Provide binaries as part of releases
3 participants